package com.braveman.im.ui.adapter;


import android.view.View;

import com.braveman.im.R;
import com.braveman.im.bean.FriendshipListBean;
import com.braveman.im.bean.MineMomentBean;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.qmuiteam.qmui.widget.QMUIRadiusImageView;

import java.util.List;

public class FriendsMomentAdapter extends BaseSectionQuickAdapter<MineMomentBean.DataListBean, BaseViewHolder> {
    private QMUIRadiusImageView avater;

    public FriendsMomentAdapter(int layoutResId, int sectionHeadResId, List data) {
        super(layoutResId, sectionHeadResId, data);

    }

    @Override
    protected void convertHead(BaseViewHolder helper, final MineMomentBean.DataListBean item) {
        helper.setText(R.id.tv_item_home_head, item.header);
    }


    @Override
    protected void convert(BaseViewHolder helper, final MineMomentBean.DataListBean item) {
        avater = helper.getView(R.id.avatar);
        avater.setCircle(false);
        if (item.photoList != null && item.photoList.size() > 0) {
            avater.setVisibility(View.VISIBLE);
            Glide.with(mContext).load(item.photoList.get(0)).into(avater);
        } else {
            avater.setVisibility(View.GONE);
        }

        helper.setText(R.id.details, item.content);

    }


}
